import time

from celery import Celery

# 1.初始化celery对象
app = Celery("dashopt",
             broker="redis://:@127.0.0.1:6379/1",
             backend="redis://:@127.0.0.1:6379/1")

# 2.创建异步任务函数
@app.task
def send_message(m, n):
    print("君不见黄河之水天上来")
    time.sleep(10)
    print("十年生死两茫茫")

    return m + n














